package com.efast.cafe.commponent.statemach.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.efast.cafe.commponent.statemach.bean.MyStateMachTaskBean;
import com.efast.cafe.commponent.statemach.bean.MyStateMachTaskQueryBean;
import com.efast.cafe.commponent.statemach.bean.StateMachByRoleBean;
import com.efast.cafe.commponent.statemach.bean.StateMachTaskBean;
import com.efast.cafe.commponent.statemach.bean.TaskBean;

public interface PortalStateMachTaskDao {

	List<MyStateMachTaskBean> getMyTaskList(@Param(value = "companyCode") String companyCode,
			@Param(value = "userName") String userName);

	List<MyStateMachTaskBean> getTaskWaitingList(@Param(value = "companyCode") String companyCode,
			@Param(value = "stateList") List<StateMachByRoleBean> stateList);

	/**
	 * 获取前N行待办列表
	 * 
	 * @param companyCode
	 * @param stateList
	 * @param n
	 * @return
	 */
	List<MyStateMachTaskBean> getTaskWaitingListTopN(@Param(value = "companyCode") String companyCode,
			@Param(value = "stateList") List<StateMachByRoleBean> stateList, @Param(value = "n") int n);

	/**
	 * 获取我的任务列表(分页)
	 * 
	 * @param QueryBean
	 * @return
	 */
	//@PaginationControl(true)
	List<MyStateMachTaskBean> getMyTaskPageList(MyStateMachTaskQueryBean QueryBean);

	/**
	 * 获取我的任务列表数量
	 * 
	 * @param QueryBean
	 * @return
	 */
	Integer getMyTaskPageCount(MyStateMachTaskQueryBean QueryBean);

	/**
	 * 获取待办任务列表(分页)
	 * 
	 * @param QueryBean
	 * @return
	 */
	//@PaginationControl(true)
	List<MyStateMachTaskBean> getTaskWaitingPageList(MyStateMachTaskQueryBean QueryBean);

	/**
	 * 获取待办任务列表数量
	 * 
	 * @param QueryBean
	 * @return
	 */
	Integer getTaskWaitingPageCount(MyStateMachTaskQueryBean QueryBean);

	/**
	 * 管理员获取待办任务列表(分页)
	 * 
	 * @param QueryBean
	 * @return
	 */
	//@PaginationControl(true)
	//List<TaskPaginationBean> getTaskWaitingPageListForAdmin(MyStateMachTaskQueryBean QueryBean);

	/**
	 * 管理员获取待办任务列表数量
	 * 
	 * @param QueryBean
	 * @return
	 */
	Integer getTaskWaitingPageCountForAdmin(MyStateMachTaskQueryBean QueryBean);

	

	/**
	 * 添加Task
	 * 
	 * @param stateMachTask
	 */
	//@SaveOrUpdateOrDelControl
	void insertState(StateMachTaskBean stateMachTask);

	/**
	 * 修改Task
	 * 
	 * @param stateMachTask
	 */
	//@SaveOrUpdateOrDelControl
	void updateStatePart(StateMachTaskBean stateMachTask);
	
	/**
	 * 根据ID获取task
	 * 
	 * @param id
	 * @return
	 */
	TaskBean getTaskById(@Param(value = "companyCode") String companyCode, @Param(value = "id") Long id);
	
	/**
	 * 根据relId获取任务列表
	 * @param relId
	 * @param relType
	 * @return
	 */
	List<TaskBean> getTaskbyRelId(@Param(value = "relId")Long relId,@Param(value = "relType") String relType,@Param(value = "companyCode")String companyCode,@Param(value = "userName")String userName);
	
}
